home *** CD-ROM | disk | FTP | other *** search
- Path: casbah.acns.nwu.edu!muzaffar
- From: muzaffar@casbah.acns.nwu.edu (Usman Muzaffar)
- Newsgroups: comp.lang.c
- Subject: Re: help!
- Date: 14 Mar 1996 19:05:39 GMT
- Organization: Northwestern University, Evanston IL
- Message-ID: <4i9qm3$i28@news.acns.nwu.edu>
- References: <4i9m2k$jcr@kirin.wwa.com>
- NNTP-Posting-Host: casbah.acns.nwu.edu
- Keywords: C question?
-
- In article <4i9m2k$jcr@kirin.wwa.com>,
- Shriram Venkatraman <shriramv@wwa.com> wrote:
- >whats the difference between malloc and realloc?
-
- Quoting directly from K&R 2nd ed, p. 252:
-
- void *malloc(size_t size)
- returns a pointer to a space for an object of size _size_, or NULL
- if request cannot be satisfied. The space is uninitialized.
-
- void *realloc(void *p,size_t size)
- changes the size of the object pointed to by p to size. The contents
- will be unchanged up to the minimum of the old and new sizes. If the
- new size is larger, the new space is uninitialized. realloc returns
- a pointer to the new space, or NULL if request can not be satisfied,
- in which case *p is unchanged.
-
-
-
-
-